home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / ocean / cacd_bin.000 / cacd_bin / bin / readgds < prev    next >
Encoding:
Text File  |  1994-05-06  |  1.1 KB  |  72 lines

  1.  
  2. : SccsId = "@(#)readgds.sh 4.1 (TU-Delft) 06/09/90"
  3. #
  4. # readgds - read a GDS II tape
  5. #
  6. # created by   : R. Paulussen
  7. # creation date: 08-Feb-1988
  8. #
  9. # All tapedata will be stored as follows:
  10. #    files        : input.gds.<vol>   
  11. # Each file will contain 1 datafile form the tape
  12. #    recordlength=2048
  13. #
  14. USAGE="Usage: readgds maincell [volume]"
  15.  
  16. if test $# -gt 2
  17. then
  18.     echo ""
  19.     echo "$USAGE"
  20.     echo ""
  21.     exit 1
  22. fi
  23.  
  24. if test $# -lt 1
  25. then
  26.     echo ""
  27.     echo "$USAGE"
  28.     echo ""
  29.     exit 1
  30. fi
  31.  
  32. for dev in /dev/rmt12 /dev/rmt/0mn /dev/rmt/1mn no_dev
  33. do
  34.     if test -r $dev
  35.     then break
  36.     fi
  37. done
  38. if test $dev = no_dev
  39. then
  40.     echo "readgds: sorry: no readable tape device exist!"
  41.     exit 1
  42. fi
  43. job=$1
  44.  
  45. if test $# -eq 2
  46. then
  47.     fileno=$2
  48. else
  49.     fileno=1
  50. fi
  51.  
  52. echo "**** readgds starting ****"
  53. echo "Reading: $job.gds.$fileno"
  54. echo "Volume: $fileno"
  55.  
  56. dd if=$dev of="$job.gds.$fileno" bs=2048 conv=noerror
  57.  
  58. if test ! -s "$job.gds.$fileno"
  59. then
  60.     echo "readgds: empty tape, no file created"
  61.     exit 1
  62. fi
  63.  
  64. echo "volume $fileno has been read"
  65. echo "**** readgds finished ****"
  66.  
  67. mt -t $dev rew
  68. mt -t $dev offl
  69. exit 0
  70.  
  71. # end of script
  72.